home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 41.zip / BS1 part 41 / LATEX macros.adf / inputs / alpha.bst < prev    next >
Text File  |  1988-02-21  |  16KB  |  865 lines

  1. % BibTeX standard bibliography style `alpha'
  2.     % version 0.98c for BibTeX versions 0.98i or later, LaTeX version 2.08
  3.     % Copyright (C) 1985, all rights reserved
  4.     % Copying of this file is authorized only if either
  5.     % (1) you make absolutely no changes to your copy, including name, or
  6.     % (2) if you do make changes, you name it something other than
  7.     % btxbst.doc, plain.bst, unsrt.bst, alpha.bst, and abbrv.bst
  8.     % This restriction helps ensure that all standard styles are identical
  9.  
  10. ENTRY
  11.   { address
  12.     author
  13.     booktitle
  14.     chapter
  15.     edition
  16.     editor
  17.     howpublished
  18.     institution
  19.     journal
  20.     key
  21.     month
  22.     note
  23.     number
  24.     organization
  25.     pages
  26.     publisher
  27.     school
  28.     series
  29.     title
  30.     type
  31.     volume
  32.     year
  33.   }
  34.   {}
  35.   { label extra.label sort.label }
  36.  
  37. INTEGERS { output.state before.all mid.sentence after.sentence after.block }
  38.  
  39. FUNCTION {init.state.consts}
  40. { 'before.all #0 :=
  41.   'mid.sentence #1 :=
  42.   'after.sentence #2 :=
  43.   'after.block #3 :=
  44. }
  45.  
  46. STRINGS { s t }
  47.  
  48. FUNCTION {output.nonnull}
  49. { 's swap$ :=
  50.   output.state mid.sentence =
  51.     { ", " * write$ }
  52.     { output.state after.block =
  53.     { add.period$ write$
  54.       newline$
  55.       "\newblock " write$
  56.     }
  57.     { output.state before.all =
  58.         'write$
  59.         { add.period$ " " * write$ }
  60.       if$
  61.     }
  62.       if$
  63.     }
  64.   if$
  65.   'output.state mid.sentence :=
  66.   s
  67. }
  68.  
  69. FUNCTION {output}
  70. { 's swap$ :=
  71.   s "" =
  72.     'skip$
  73.     { s output.nonnull }
  74.   if$
  75. }
  76.  
  77. FUNCTION {output.check}
  78. { 's swap$ :=
  79.   't swap$ :=
  80.   s "" =
  81.     { "Warning: the " t * " shouldn't be empty in " * cite$ * top$ }
  82.     { s output.nonnull }
  83.   if$
  84. }
  85.  
  86. FUNCTION {output.bibitem}
  87. { newline$
  88.   "\bibitem[" write$
  89.   label write$
  90.   "]{" write$
  91.   cite$ write$
  92.   "}" write$
  93.   newline$
  94.   ""
  95.   'output.state before.all :=
  96. }
  97.  
  98. FUNCTION {fin.entry}
  99. { add.period$
  100.   write$
  101.   newline$
  102. }
  103.  
  104. FUNCTION {new.block}
  105. { output.state before.all =
  106.     'skip$
  107.     { 'output.state after.block := }
  108.   if$
  109. }
  110.  
  111. FUNCTION {new.sentence}
  112. { output.state after.block =
  113.     'skip$
  114.     { output.state before.all =
  115.     'skip$
  116.     { 'output.state after.sentence := }
  117.       if$
  118.     }
  119.   if$
  120. }
  121.  
  122. FUNCTION {not}
  123. {   { #0 }
  124.     { #1 }
  125.   if$
  126. }
  127.  
  128. FUNCTION {and}
  129. {   'skip$
  130.     { pop$ #0 }
  131.   if$
  132. }
  133.  
  134. FUNCTION {or}
  135. {   { pop$ #1 }
  136.     'skip$
  137.   if$
  138. }
  139.  
  140. FUNCTION {field.or.null}
  141. { duplicate$
  142.   missing$
  143.     { pop$ "" }
  144.     'skip$
  145.   if$
  146. }
  147.  
  148. FUNCTION {italicize}
  149. { 's swap$ :=
  150.   s "" =
  151.     { "" }
  152.     { "{\it " s * "}" * }
  153.   if$
  154. }
  155.  
  156. INTEGERS { nameptr namesleft numnames }
  157.  
  158. STRINGS {nameresult}
  159.  
  160. FUNCTION {format.names}
  161. { 's swap$ :=
  162.   'nameptr #1 :=
  163.   'nameresult "" :=
  164.   'numnames s num.names$ :=
  165.   'namesleft numnames :=
  166.     { namesleft #0 > }
  167.     {
  168.       't s nameptr "{ff }{vv~}{ll}{, jj}" format.name$ :=
  169.       nameptr #1 >
  170.     { namesleft #1 >
  171.         { 'nameresult nameresult ", " * t * := }
  172.         { numnames #2 >
  173.         { 'nameresult nameresult "," * := }
  174.         'skip$
  175.           if$
  176.           t "others" =
  177.         { 'nameresult nameresult " et al." * := }
  178.         { 'nameresult nameresult " and " * t * := }
  179.           if$
  180.         }
  181.       if$
  182.     }
  183.     { 'nameresult nameresult t * := }
  184.       if$
  185.       'nameptr nameptr #1 + :=
  186.       'namesleft namesleft #1 - :=
  187.     }
  188.   while$
  189.   nameresult
  190. }
  191.  
  192. FUNCTION {format.authors}
  193. { author missing$
  194.     { "" }
  195.     { author format.names }
  196.   if$
  197. }
  198.  
  199. FUNCTION {format.editors}
  200. { editor missing$
  201.     { "" }
  202.     { editor num.names$ #1 >
  203.     { editor format.names ", editors" * }
  204.     { editor format.names ", editor" * }
  205.       if$
  206.     }
  207.   if$
  208. }
  209.  
  210. FUNCTION {format.title}
  211. { title missing$
  212.     { "" }
  213.     { title "ul" change.case$ }
  214.   if$
  215. }
  216.  
  217. FUNCTION {entry.string.max} { #100 }
  218.  
  219. FUNCTION {global.string.max} { #300 }
  220.  
  221. STRINGS {pageresult}
  222.  
  223. FUNCTION {n.dashify}
  224. { 't swap$ :=
  225.   'pageresult "" :=
  226.     { t "" = not }
  227.     { t #1 #1 substring$ "-" =
  228.     { t #1 #2 substring$ "--" = not
  229.         { 'pageresult pageresult "--" * :=
  230.           't t #2 global.string.max substring$ :=
  231.         }
  232.         {   { t #1 #1 substring$ "-" = }
  233.         { 'pageresult pageresult "-" * :=
  234.           't t #2 global.string.max substring$ :=
  235.         }
  236.           while$
  237.         }
  238.       if$
  239.     }
  240.     { 'pageresult pageresult t #1 #1 substring$ * :=
  241.       't t #2 global.string.max substring$ :=
  242.     }
  243.       if$
  244.     }
  245.   while$
  246.   pageresult
  247. }
  248.  
  249. FUNCTION {format.date}
  250. { year missing$
  251.     { month missing$
  252.     { "" }
  253.     { "Warning: there's a month but no year in " cite$ * top$
  254.       month
  255.     }
  256.       if$
  257.     }
  258.     { month missing$
  259.     { year }
  260.     { month " " * year * }
  261.       if$
  262.     }
  263.   if$
  264. }
  265.  
  266. FUNCTION {format.btitle}
  267. { title field.or.null
  268.   italicize
  269. }
  270.  
  271. FUNCTION {format.bvolume}
  272. { volume missing$
  273.     { series missing$
  274.     { "" }
  275.     { series italicize }
  276.       if$
  277.     }
  278.     { "Volume~" volume *
  279.       series missing$
  280.     'skip$
  281.     { " of " * series italicize * }
  282.       if$
  283.     }
  284.   if$
  285. }
  286.  
  287. FUNCTION {format.edition}
  288. { edition missing$
  289.     { "" }
  290.     { edition "ll" change.case$ " edition" * }
  291.   if$
  292. }
  293.  
  294. INTEGERS {multiresult}
  295.  
  296. FUNCTION {multi.page.check}
  297. { 't swap$ :=
  298.   'multiresult #0 :=
  299.     { multiresult not
  300.       t "" = not
  301.       and
  302.     }
  303.     { t #1 #1 substring$ "-" =
  304.       t #1 #1 substring$ "," =
  305.       or
  306.     { 'multiresult #1 := }
  307.     { 't t #2 global.string.max substring$ := }
  308.       if$
  309.     }
  310.   while$
  311.   multiresult
  312. }
  313.  
  314. FUNCTION {format.pages}
  315. { pages missing$
  316.     { "" }
  317.     { pages multi.page.check
  318.     { "pages~" pages n.dashify * }
  319.     { "page~" pages n.dashify * }
  320.       if$
  321.     }
  322.   if$
  323. }
  324.  
  325. FUNCTION {format.vol.num.pages}
  326. { volume field.or.null
  327.   number missing$
  328.     'skip$
  329.     { "(" number * ")" * *
  330.       volume missing$
  331.     { "Warning: there's a number but no volume in " cite$ * top$ }
  332.     'skip$
  333.       if$
  334.     }
  335.   if$
  336.   pages missing$
  337.     'skip$
  338.     { duplicate$ "" =
  339.     'skip$
  340.     { ":" * }
  341.       if$
  342.       pages n.dashify *
  343.     }
  344.   if$
  345. }
  346.  
  347. FUNCTION {format.chapter.pages}
  348. { chapter missing$
  349.     'format.pages
  350.     { "chapter~" chapter *
  351.       pages missing$
  352.     'skip$
  353.     { ", " * format.pages * }
  354.       if$
  355.     }
  356.   if$
  357. }
  358.  
  359. FUNCTION {format.in.ed.booktitle}
  360. { booktitle missing$
  361.     { "" }
  362.     { 's format.editors :=
  363.       s "" =
  364.     { "In " booktitle italicize * }
  365.     { "In " s * ", " * booktitle italicize * }
  366.       if$
  367.     }
  368.   if$
  369. }
  370.  
  371. FUNCTION {format.tr.number}
  372. { type missing$
  373.     { "Technical Report" }
  374.     { type }
  375.   if$
  376.   number missing$
  377.     'skip$
  378.     { "~" * number * }
  379.   if$
  380. }
  381.  
  382. FUNCTION {article}
  383. { output.bibitem
  384.   "author" format.authors output.check
  385.   new.block
  386.   "title" format.title output.check
  387.   new.block
  388.   "journal" journal field.or.null italicize output.check
  389.   format.vol.num.pages output
  390.   "year" format.date output.check
  391.   new.block
  392.   note field.or.null output
  393.   fin.entry
  394. }
  395.  
  396. FUNCTION {book}
  397. { output.bibitem
  398.   author missing$
  399.     { "author and editor" format.editors output.check }
  400.     { "author" format.authors output.check }
  401.   if$
  402.   new.block
  403.   "title" format.btitle output.check
  404.   new.block
  405.   format.bvolume output
  406.   "publisher" publisher field.or.null output.check
  407.   address field.or.null output
  408.   format.edition output
  409.   "year" format.date output.check
  410.   new.block
  411.   note field.or.null output
  412.   fin.entry
  413. }
  414.  
  415. FUNCTION {booklet}
  416. { output.bibitem
  417.   format.authors output
  418.   new.block
  419.   "title" format.btitle output.check
  420.   new.block
  421.   howpublished field.or.null output
  422.   address field.or.null output
  423.   format.date output
  424.   new.block
  425.   note field.or.null output
  426.   fin.entry
  427. }
  428.  
  429. FUNCTION {inbook}
  430. { output.bibitem
  431.   author missing$
  432.     { "author and editor" format.editors output.check }
  433.     { "author" format.authors output.check }
  434.   if$
  435.   new.block
  436.   "title" format.btitle output.check
  437.   "chapter and pages" format.chapter.pages output.check
  438.   new.block
  439.   format.bvolume output
  440.   "publisher" publisher field.or.null output.check
  441.   address field.or.null output
  442.   format.edition output
  443.   "year" format.date output.check
  444.   new.block
  445.   note field.or.null output
  446.   fin.entry
  447. }
  448.  
  449. FUNCTION {incollection}
  450. { output.bibitem
  451.   "authors" format.authors output.check
  452.   new.block
  453.   "title" format.title output.check
  454.   new.block
  455.   "booktitle" format.in.ed.booktitle output.check
  456.   format.chapter.pages output
  457.   "publisher" publisher field.or.null output.check
  458.   address field.or.null output
  459.   "year" format.date output.check
  460.   new.block
  461.   note field.or.null output
  462.   fin.entry
  463. }
  464.  
  465. FUNCTION {inproceedings}
  466. { output.bibitem
  467.   "author" format.authors output.check
  468.   new.block
  469.   "title" format.title output.check
  470.   new.block
  471.   "booktitle" format.in.ed.booktitle output.check
  472.   format.pages output
  473.   organization field.or.null output
  474.   publisher field.or.null output
  475.   address field.or.null output
  476.   "year" format.date output.check
  477.   new.block
  478.   note field.or.null output
  479.   fin.entry
  480. }
  481.  
  482. FUNCTION {conference} { inproceedings }
  483.  
  484. FUNCTION {manual}
  485. { output.bibitem
  486.   format.authors output
  487.   new.block
  488.   "title" format.btitle output.check
  489.   new.block
  490.   organization field.or.null output
  491.   address field.or.null output
  492.   format.edition output
  493.   format.date output
  494.   new.block
  495.   note field.or.null output
  496.   fin.entry
  497. }
  498.  
  499. FUNCTION {mastersthesis}
  500. { output.bibitem
  501.   "author" format.authors output.check
  502.   new.block
  503.   "title" format.btitle output.check
  504.   new.block
  505.   "Master's thesis" output
  506.   "school" school field.or.null output.check
  507.   address field.or.null output
  508.   "year" format.date output.check
  509.   new.block
  510.   note field.or.null output
  511.   fin.entry
  512. }
  513.  
  514. FUNCTION {misc}
  515. { output.bibitem
  516.   format.authors output
  517.   new.block
  518.   format.title output
  519.   new.block
  520.   howpublished field.or.null output
  521.   format.date output
  522.   new.block
  523.   note field.or.null output
  524.   fin.entry
  525. }
  526.  
  527. FUNCTION {phdthesis}
  528. { output.bibitem
  529.   "author" format.authors output.check
  530.   new.block
  531.   "title" format.btitle output.check
  532.   new.block
  533.   "PhD thesis" output
  534.   "school" school field.or.null output.check
  535.   address field.or.null output
  536.   "year" format.date output.check
  537.   new.block
  538.   note field.or.null output
  539.   fin.entry
  540. }
  541.  
  542. FUNCTION {proceedings}
  543. { output.bibitem
  544.   editor missing$
  545.     { organization missing$
  546.     'skip$
  547.     { organization field.or.null output }
  548.       if$
  549.     }
  550.     { format.editors output }
  551.   if$
  552.   new.block
  553.   "title" format.btitle output.check
  554.   editor missing$
  555.     'skip$
  556.     { organization field.or.null output }
  557.   if$
  558.   publisher field.or.null output
  559.   address field.or.null output
  560.   "year" format.date output.check
  561.   new.block
  562.   note field.or.null output
  563.   fin.entry
  564. }
  565.  
  566. FUNCTION {techreport}
  567. { output.bibitem
  568.   "author" format.authors output.check
  569.   new.block
  570.   "title" format.btitle output.check
  571.   new.block
  572.   format.tr.number output
  573.   "institution" institution field.or.null output.check
  574.   address field.or.null output
  575.   "year" format.date output.check
  576.   new.block
  577.   note field.or.null output
  578.   fin.entry
  579. }
  580.  
  581. FUNCTION {unpublished}
  582. { output.bibitem
  583.   "author" format.authors output.check
  584.   new.block
  585.   "title" format.title output.check
  586.   new.block
  587.   format.date output
  588.   new.block
  589.   "note" note field.or.null output.check
  590.   fin.entry
  591. }
  592.  
  593. FUNCTION {default.type} { book }
  594.  
  595. MACRO {jan} {"January"}
  596.  
  597. MACRO {feb} {"February"}
  598.  
  599. MACRO {mar} {"March"}
  600.  
  601. MACRO {apr} {"April"}
  602.  
  603. MACRO {may} {"May"}
  604.  
  605. MACRO {jun} {"June"}
  606.  
  607. MACRO {jul} {"July"}
  608.  
  609. MACRO {aug} {"August"}
  610.  
  611. MACRO {sep} {"September"}
  612.  
  613. MACRO {oct} {"October"}
  614.  
  615. MACRO {nov} {"November"}
  616.  
  617. MACRO {dec} {"December"}
  618.  
  619. MACRO {acmcs} {"ACM Computing Surveys"}
  620.  
  621. MACRO {acta} {"Acta Informatica"}
  622.  
  623. MACRO {cacm} {"Communications of the ACM"}
  624.  
  625. MACRO {ibmjrd} {"IBM Journal of Research and Development"}
  626.  
  627. MACRO {ibmsj} {"IBM Systems Journal"}
  628.  
  629. MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
  630.  
  631. MACRO {ieeetc} {"IEEE Transactions on Computers"}
  632.  
  633. MACRO {ieeetcad}
  634.  {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
  635.  
  636. MACRO {ipl} {"Information Processing Letters"}
  637.  
  638. MACRO {jacm} {"Journal of the ACM"}
  639.  
  640. MACRO {jcss} {"Journal of Computer and System Sciences"}
  641.  
  642. MACRO {scp} {"Science of Computer Programming"}
  643.  
  644. MACRO {sicomp} {"SIAM Journal on Computing"}
  645.  
  646. MACRO {tocs} {"ACM Transactions on Computer Systems"}
  647.  
  648. MACRO {tods} {"ACM Transactions on Database Systems"}
  649.  
  650. MACRO {tog} {"ACM Transactions on Graphics"}
  651.  
  652. MACRO {toms} {"ACM Transactions on Mathematical Software"}
  653.  
  654. MACRO {toois} {"ACM Transactions on Office Information Systems"}
  655.  
  656. MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
  657.  
  658. MACRO {tcs} {"Theoretical Computer Science"}
  659.  
  660. READ
  661.  
  662. FUNCTION {sortify}
  663. { purify$
  664.   "ll" change.case$
  665. }
  666.  
  667. FUNCTION {format.lab.names}
  668. { 's swap$ :=
  669.   'numnames s num.names$ :=
  670.   numnames #1 >
  671.     { numnames #4 >
  672.     { 'namesleft #3 := }
  673.     { 'namesleft numnames := }
  674.       if$
  675.       'nameptr #1 :=
  676.       'nameresult "" :=
  677.     { namesleft #0 > }
  678.     { nameptr numnames =
  679.         { s nameptr "{ff}{vv}{ll}{jj}" format.name$ "others" =
  680.         { 'nameresult nameresult "*" * := }
  681.         { 'nameresult nameresult s nameptr "{v{}}{l{}}" format.name$
  682.           * :=
  683.         }
  684.           if$
  685.         }
  686.         { 'nameresult nameresult s nameptr "{v{}}{l{}}" format.name$
  687.           * :=
  688.         }
  689.       if$
  690.       'nameptr nameptr #1 + :=
  691.       'namesleft namesleft #1 - :=
  692.     }
  693.       while$
  694.       numnames #4 >
  695.     { 'nameresult nameresult "*" * := }
  696.     'skip$
  697.       if$
  698.     }
  699.     { 't s #1 "{v{}}{l{}}" format.name$ :=
  700.       'nameresult
  701.       t #2 #1 substring$ "" =
  702.     { s #1 "{ll}" format.name$ purify$ #1 #3 substring$ }
  703.     { t }
  704.       if$
  705.       :=
  706.     }
  707.   if$
  708.   nameresult
  709. }
  710.  
  711. FUNCTION {calc.label}
  712. { 'label
  713.   author missing$
  714.     { editor missing$
  715.     { key missing$
  716.         { "Warning: need a key to make a label in " cite$ * top$
  717.           title field.or.null purify$ #1 #3 substring$
  718.         }
  719.         { key purify$ #1 #3 substring$ }
  720.       if$
  721.     }
  722.     { editor format.lab.names }
  723.       if$
  724.     }
  725.     { author format.lab.names }
  726.   if$
  727.   year field.or.null purify$ #-1 #2 substring$
  728.   *
  729.   :=
  730.   'sort.label label sortify :=
  731. }
  732.  
  733. FUNCTION {sort.format.names}
  734. { 's swap$ :=
  735.   'nameptr #1 :=
  736.   'nameresult "" :=
  737.   'numnames s num.names$ :=
  738.   'namesleft numnames :=
  739.     { namesleft #0 > }
  740.     { nameptr #1 >
  741.     { 'nameresult nameresult "   " * := }
  742.     'skip$
  743.       if$
  744.       't s nameptr "{vv{ } }{ll{ }}{  ff{ }}{  jj{ }}" format.name$ :=
  745.       nameptr numnames = t "others" = and
  746.     { 'nameresult nameresult "et al" * := }
  747.     { 'nameresult nameresult t sortify * := }
  748.       if$
  749.       'nameptr nameptr #1 + :=
  750.       'namesleft namesleft #1 - :=
  751.     }
  752.   while$
  753.   nameresult
  754. }
  755.  
  756. INTEGERS {len}
  757.  
  758. FUNCTION {chop.word}
  759. { 's swap$ :=
  760.   'len swap$ :=
  761.   s #1 len substring$ =
  762.     { s len #1 + global.string.max substring$ }
  763.     { s }
  764.   if$
  765. }
  766.  
  767. FUNCTION {sort.format.title}
  768. { 't swap$ :=
  769.   "A " #2
  770.     "An " #3
  771.       "The " #4 t chop.word
  772.     chop.word
  773.   chop.word
  774.   #1 global.string.max substring$
  775.   sortify
  776. }
  777.  
  778. FUNCTION {presort}
  779. {
  780.   calc.label
  781.   sort.label
  782.   "    "
  783.   *
  784.   author missing$
  785.     { editor missing$
  786.     { key field.or.null sortify }
  787.     { editor sort.format.names }
  788.       if$
  789.     }
  790.     { author sort.format.names }
  791.   if$
  792.   *
  793.   "    "
  794.   *
  795.   title field.or.null
  796.   sort.format.title
  797.   *
  798.   #1 entry.string.max substring$
  799.   'sort.key$ swap$ :=
  800. }
  801.  
  802. ITERATE {presort}
  803.  
  804. SORT
  805.  
  806. STRINGS { longest.label last.sort.label next.extra }
  807.  
  808. INTEGERS { longest.label.width last.extra.num }
  809.  
  810. FUNCTION {initialize.longest.label}
  811. { 'longest.label "" :=
  812.   'last.sort.label "" :=
  813.   'next.extra "" :=
  814.   'longest.label.width #0 :=
  815.   'last.extra.num #0 :=
  816. }
  817.  
  818. FUNCTION {forward.pass}
  819. { last.sort.label sort.label =
  820.     { 'last.extra.num last.extra.num #1 + :=
  821.       'extra.label last.extra.num int.to.chr$ :=
  822.     }
  823.     { 'last.extra.num "a" chr.to.int$ :=
  824.       'extra.label "" :=
  825.       'last.sort.label sort.label :=
  826.     }
  827.   if$
  828. }
  829.  
  830. FUNCTION {reverse.pass}
  831. { next.extra "b" =
  832.     { 'extra.label "a" := }
  833.     'skip$
  834.   if$
  835.   'label label extra.label * :=
  836.   label width$ longest.label.width >
  837.     { 'longest.label label :=
  838.       'longest.label.width label width$ :=
  839.     }
  840.     'skip$
  841.   if$
  842.   'next.extra extra.label :=
  843. }
  844.  
  845. EXECUTE {initialize.longest.label}
  846.  
  847. ITERATE {forward.pass}
  848.  
  849. REVERSE {reverse.pass}
  850.  
  851. FUNCTION {preamble}
  852. { "\begin{thebibliography}{"  longest.label  * "}" * write$
  853.   newline$
  854. }
  855.  
  856. EXECUTE {preamble}
  857.  
  858. EXECUTE {init.state.consts}
  859.  
  860. ITERATE {call.type$}
  861.  
  862. FUNCTION {finish.up} { newline$ "\end{thebibliography}" write$ newline$ }
  863.  
  864. EXECUTE {finish.up}
  865.